

//第二步导入这个包
import VueRouter from 'vue-router'
// 导入对应的组件
import home from './component/home.vue'
import member from './component/member.vue'
import shopcar from './component/shopcar.vue'
import search from './component/search.vue'
import newList from './new/newList.vue'
import newsInfo from './new/newsInfo.vue'
import photo from './component/photo/photo.vue'
import photoinfo from './component/photo/photoinfo.vue'
import goodlist from './component/good/goodlist.vue'
import goodsinfo from './component/good/goodsinfo.vue'
import goodscom from './component/good/goodscom.vue'
import goodsdes from './component/good/goodsdes.vue'
var router = new VueRouter({
    routes: [//配置路由规则
        {path:'/',redirect:'/home'},
       {path:'/home',component:home},
       {path:'/member',component:member},
       {path:'/shopcar',component:shopcar},
       {path:'/search',component:search},
       {path:'/home/newList',component:newList},
       {path:'/home/newsInfo/:id',component:newsInfo},//这里的冒号代表id只是一个参数
       {path:'/home/photo',component:photo},
       {path:'/home/photoinfo/:id',component:photoinfo},
       {path:'/home/goodlist',component:goodlist},
       {path:'/home/goodsinfo/:id',component:goodsinfo},
       {path:'/home/goodscom/:id' ,component:goodscom,name:'com'},
       {path:'/home/goodsdes/:id',component:goodsdes,name:'des'}
    ],
    linkActiveClass:'mui-active'//修改默认的高亮类router-link-active
})
export default router